/* eslint-disable no-unused-vars */
import React, { Fragment } from 'react';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import { Alert } from 'antd';
import { CopyrightOutlined, NotificationOutlined } from '@ant-design/icons';
import GlobalFooter from '@/components/GlobalFooter';
import SelectLang from '@/components/SelectLang';
import downloadFile from '@/utils/utils';
import styles from './UserLayout.less';
import logo from '../assets/login-logo.svg';
import notifiImg from '../assets/notice-icon.png';
import loginLogo from '../assets/rlb.png';
import safeNotice from '../assets/safe-notice.docx';
// import logoLeft from '../assets/login-logo-left.png';
// import logoRight from '../assets/login-logo-right.png';

// import loginLeft from '../assets/login-left.png';
// import loginRight from '../assets/login-right.png';

const links = [
  {
    key: 'help',
    title: formatMessage({ id: 'layout.user.link.help' }),
    href: '',
  },
  {
    key: 'privacy',
    title: formatMessage({ id: 'layout.user.link.privacy' }),
    href: '',
  },
  {
    key: 'terms',
    title: formatMessage({ id: 'layout.user.link.terms' }),
    href: '',
  },
];

const copyright = (
  <Fragment>
    <div className={styles.downloadChrome}>
      建议使用&nbsp;&nbsp;{' '}
      <a href="https://www.google.cn/chrome/" target="_blank" rel="noopener noreferrer">
        Google Chrome
      </a>
      &nbsp;&nbsp; 最新版&nbsp;&nbsp;现代浏览器访问本系统
    </div>{' '}
    <div className={styles.copyRight}>
      Copyright <CopyrightOutlined /> 2021  北京蓝晶林科技有限公司
      <a href="https://beian.miit.gov.cn/#/Integrated/index" style={{display:"block",marginTop:5}}>京ICP备2020032310号-5</a> 
    </div>
  </Fragment>
);

class UserLayout extends React.PureComponent {
  // @TODO title
  // getPageTitle() {
  //   const { routerData, location } = this.props;
  //   const { pathname } = location;
  //   let title = 'Ant Design Pro';
  //   if (routerData[pathname] && routerData[pathname].name) {
  //     title = `${routerData[pathname].name} - Ant Design Pro`;
  //   }
  //   return title;
  // }

  render() {
    const { children } = this.props;
    return (
      // @TODO <DocumentTitle title={this.getPageTitle()}>
      <div className={styles.container}>
        {/* <div className={styles.lang}><SelectLang /></div> */}
        <div className={styles.logo}>
          <img src={loginLogo} alt="logo" />
          {/* <img alt="logo" src={logo} draggable="false" /> */}
        </div>
        {/* <div className={styles.bgImg}>
          <img alt="loginLeft" src={logoLeft} draggable="false" />
          <img alt="loginRight" src={logoRight} draggable="false" />
        </div> */}
        <div className={styles.content}>
          <div className={styles.loginLeft}>
            <p>人力邦平台</p>
            <p>安全有效的人力资源管理平台</p>
          </div>
          <div className={styles.mainContainer}>
            <div className={styles.top}>
              <div className={styles.header}>
                <Link to="/">
                  {/* <img alt="logo" className={styles.logo} src={logo} /> */}
                  <span className={styles.title}>登录</span>
                </Link>
              </div>
            </div>
            {children}
          </div>
        </div>
        <div
          style={{
            display: 'flex',
            justifyContent: 'center',
            alignItems: 'center',
            position: 'relative',
          }}
        >
          {/* <Alert
            style={{
              position: 'absolute',
              left: '50%',
              bottom: 20,
              width: 600,
              transform: 'translate(-50%)',
              maxWidth: '100%',
            }}
            message={
              <span>
                <img src={notifiImg} alt="消息通知" />
                【重要通知】 关于进一步增强FESCO网站安全性的提示，详见
                <a
                  href={safeNotice}
                  download="关于进一步增强FESCO网站安全性的提示.docx"
                  style={{ marginLeft: 10, textDecoration: 'none' }}
                >
                  附件内容
                </a>
              </span>
            }
            type="error"
            closable
          /> */}
        </div>
        <GlobalFooter copyright={copyright} />
      </div>
    );
  }
}

export default UserLayout;
